import com.baizhi.dao.CityDAO;
import com.baizhi.entity.City;
import com.baizhi.service.CityService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class test {
    @Autowired
    private CityService cityService;

    @Autowired
    private CityDAO cityDAO;


    @Test
    public void test2(){
        List<City> cities = cityDAO.queryAll();
        cities.forEach(c-> System.out.println("c = " + c));
    }

    @Test
    public void test1(){
        List<City> cities = cityService.queryAll();
        for (City city : cities) {

            System.out.println("city = " + city);
        }
    }
}
